The PointIterator object contains the following methods:
The Initialize method initializes a Point Iterator object.
Initialize(VhsSiteService As String, OrderByPointIdLong As Long, Unused As Long) As Long
| Parameter | Required | Description |
|---|---|---|
|
VhsSiteService |
Yes |
The site and service name of the VHS point tag, in "site.service" format. |
|
OrderByPointIdLong |
Yes |
Set to any nonzero number to sort the points alphabetically by Long ID, or zero to leave them unsorted. |
|
Unused |
Yes |
This can be any Long number, but it doesn’t affect anything. |
This function initializes the point iterator object to the start or end of the point list, depending on the value of Backward. The return value is based on whether the initialization was successful or not (1 = Success; 0 = Failure). When initialized, the iterator cursor moves to the first point by default.
Example
The following subroutine demonstrates the use of the Initialize, MoveFirst, and GetForward methods of the PointIterator Object. It displays a list of all points in a VHS.
|
Sub ShowAllPoints (vhsService) Dim vhsPointIter, vhsHistoryIter, tag, stat lstPoints.ResetContent
Set vhsPointIter = CreateObject("CxVhsLib.PointIterator") Set tag = CreateObject("CxVhsLib.HistoryTagStringEx") Set stat = CreateObject("CxVhsLib.HistoryStats")
'Initialize point iterator with Short Point ID, going forward vhsPointIter.Initialize vhsService, 0, 0 vhsPointIter.MoveFirst
'Show all points in a list box While (vhsPointIter.GetForward(tag, stat)) lstPoints.AddString(tag.TagString) Wend End Sub |
The GetBackward method retrieves information about the previous point in the iteration list.
GetBackward(pTag As Variant, pStats As Variant) As Long
| Parameter | Required | Description |
|---|---|---|
|
pTag |
Yes |
Output. Returns the site, service, Short Point ID, Long Point ID, and tag string for a point in the VHS. Type: HistoryTagStringEx |
|
pStats |
Yes |
Output. Returns the entry count, timestamp start, timestamp end, and expiration days for a point in the VHS. Type: HistoryStats |
The GetBackward function retrieves information for a point and moves the cursor backward. The return value is 1 while there are still points in the list. When the end of the list is reached, 0 is returned.
Example
The following subroutine demonstrates the use of the Initialize, MoveLast, and GetBackward methods of the PointIterator Object. It displays a list of the last thirty points in a VHS.
|
Sub ShowLastThirty (vhsService) Dim vhsPointIter, vhsHistoryIter, tag, stat, counter lstPoints.ResetContent counter = 0
Set vhsPointIter = CreateObject("CxVhsLib.PointIterator") Set tag = CreateObject("CxVhsLib.HistoryTagStringEx") Set stat = CreateObject("CxVhsLib.HistoryStats")
'Initialize point iterator with Long Point ID, going backward vhsPointIter.Initialize vhsService, 1, 1 vhsPointIter.MoveLast
'Show all points in a list box While ((vhsPointIter.GetBackward(tag, stat)) And (counter < 30)) lstPoints.AddString(tag.TagString) counter = counter + 1; Wend End Sub |
The GetForward method retrieves information about the next point in the iteration list.
GetForward(pTag As Variant, pStats As Variant) As Long
| Parameter | Required | Description |
|---|---|---|
|
pTag |
Yes |
Output. Returns the site, service, Short Point ID, Long Point ID, and tag string for a point in the VHS. Type: HistoryTagStringEx |
|
pStats |
Yes |
Output. Returns the entry count, timestamp start, timestamp end, and expiration days for a point in the VHS. Type: HistoryStats |
The GetForward function retrieves information for the next point and moves the cursor forward. The return value is 1 while there are still points in the list. When the end of the list is reached, 0 is returned.
Example
The following subroutine demonstrates the use of the Initialize, MoveFirst, and GetForward methods of the PointIterator Object. It displays a list of all points in a VHS.
|
Sub ShowAllPoints (vhsService) Dim vhsPointIter, vhsHistoryIter, tag, stat lstPoints.ResetContent
Set vhsPointIter = CreateObject("CxVhsLib.PointIterator") Set tag = CreateObject("CxVhsLib.HistoryTagStringEx") Set stat = CreateObject("CxVhsLib.HistoryStats")
'Initialize point iterator with Short Point ID, going forward vhsPointIter.Initialize vhsService, 0, 0 vhsPointIter.MoveFirst
'Show all points in a list box While (vhsPointIter.GetForward(tag, stat)) lstPoints.AddString(tag.TagString) Wend End Sub |
The MoveAfter method moves the cursor after the given point.
MoveAfter(pTag As Variant) As Long
| Parameter | Required | Description |
|---|---|---|
|
pTag |
Yes |
Sets the point to move the cursor after. Type: HistoryTagStringEx |
The MoveAfter function moves the cursor forward without retrieving information.
The MoveBefore method moves the cursor before the given point.
MoveBefore(pTag As Variant) As Long
| Parameter | Required | Description |
|---|---|---|
|
pTag |
Yes |
Sets the point to move the cursor before. Type: HistoryTagStringEx |
The MoveBefore function moves the cursor backwards without retrieving information.
The MoveFirst method moves to the first entry in the iteration list.
MoveFirst() As Long
Returns a value based on whether the method was successful or not (1 = Success; 0 = Failure).
Example
The following subroutine demonstrates the use of the Initialize, MoveFirst, and GetForward methods of the PointIterator Object. It displays a list of all points in a VHS.
|
Sub ShowAllPoints (vhsService) Dim vhsPointIter, vhsHistoryIter, tag, stat lstPoints.ResetContent
Set vhsPointIter = CreateObject("CxVhsLib.PointIterator") Set tag = CreateObject("CxVhsLib.HistoryTagStringEx") Set stat = CreateObject("CxVhsLib.HistoryStats")
'Initialize point iterator with Short Point ID, going forward vhsPointIter.Initialize vhsService, 0, 0 vhsPointIter.MoveFirst
'Show all points in a list box While (vhsPointIter.GetForward(tag, stat)) lstPoints.AddString(tag.TagString) Wend End Sub |
The MoveLast method moves to the last entry in the iteration list.
MoveLast() As Long
Returns a value based on whether the method was successful or not (1 = Success; 0 = Failure).
Example
The following subroutine demonstrates the use of the Initialize, MoveLast, and GetBackward methods of the PointIterator Object. It displays a list of the last thirty points in a VHS.
|
Sub ShowLastThirty (vhsService) Dim vhsPointIter, vhsHistoryIter, tag, stat, counter lstPoints.ResetContent counter = 0
Set vhsPointIter = CreateObject("CxVhsLib.PointIterator") Set tag = CreateObject("CxVhsLib.HistoryTagStringEx") Set stat = CreateObject("CxVhsLib.HistoryStats")
'Initialize point iterator with Long Point ID, going backward vhsPointIter.Initialize vhsService, 1, 1 vhsPointIter.MoveLast
'Show all points in a list box While ((vhsPointIter.GetBackward(tag, stat)) And (counter < 30)) lstPoints.AddString(tag.TagString) counter = counter + 1; Wend End Sub |
The MoveTo method moves the cursor to the given point.
MoveTo(pTag As Variant) As Long
| Parameter | Required | Description |
|---|---|---|
|
pTag |
Yes |
Sets the point to move the cursor to. Type: HistoryTagStringEx |
The MoveTo function moves the cursor without retrieving information.
Example
The following example demonstrates the use of MoveTo, Initialize, and GetForward. It jumps to a specified point and displays all the points after it in a list box.
|
Sub VhsMoveTo() Dim VhsPointIter, Tag, Stat Set VhsPointIter = CreateObject("CxVhsLib.PointIterator") Set Tag = CreateObject("CxVhsLib.HistoryTagStringEx") Set Stat = CreateObject("CxVhsLib.HistoryStats")
Tag.TagString = "CYGDEMO.VHS.00000068"
VhsPointIter.Initialize "CYGDEMO.VHS", 1, 1 VhsPointIter.MoveTo(Tag)
'Show remaining points in a list box While ((VhsPointIter.GetForward(tag, stat)) lstPoints.AddString(tag.TagString) Wend End Sub |